package com.rzjm.exercise.sys.system.user.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rzjm.exercise.common.base.service.BaseService;
import com.rzjm.exercise.module.domain.CkTerminal;
import com.rzjm.exercise.sys.system.dept.domain.DeptDO;
import com.rzjm.exercise.sys.system.user.domain.UserDO;
import com.rzjm.exercise.sys.vo.Tree;
import com.rzjm.exercise.sys.vo.UserVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

@Service
public interface UserService extends BaseService<UserDO> {

	UserDO get(Integer id);

	int register(UserDO user);

	int update(UserDO user);

	boolean exit(Map<String, Object> params);

	int resetPwd(UserVO userVO, UserDO userDO) throws Exception;

	int adminResetPwd(UserVO userVO) throws Exception;

	Tree<DeptDO> getTree();

	UserDO getPwd(String username, String password);

	/**
	 * 更新个人信息
	 * @param userDO
	 * @return
	 */
	int updatePersonal(UserDO userDO);

	/**
	 * 更新个人图片
	 * @param file 图片
	 * @param avatar_data 裁剪信息
	 * @param userId 用户ID
	 * @throws Exception
	 */
    Map<String, Object> updatePersonalImg(MultipartFile file, String avatar_data, Integer userId) throws Exception;

	List<UserDO> getPageByUserId(Map<String,Object> map);

	Integer getCountBySysUserId(Map<String,Object> map);

	List<UserDO> getBaoBaoListByUserId(Page page, Map<String,Object> map);
}
